package cn.calm.swing.osgi.api.util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import cn.calm.swing.osgi.api.Filter;

public class ServiceUtil {
	public static <E>  List<E> filter(Collection<E> serviceReferences,Filter<E> filter){
		List<E> listTemp=new ArrayList<E>();
		for(E e:serviceReferences){
			if(filter.filter(e)){
				listTemp.add(e);
			}
		}
		return listTemp;
	}
}
